﻿@using System.Data
@using ZoomLa.Common
@using ZoomLa.Model
@using ZoomLa.BLL
@model ZoomLa.SQLDAL.SQL.PageSetting
@functions{
    public string GetQuesType(DataRow dr)
    {
        int questype = DataConverter.CLng(dr["p_type"]);
        return questype == 10 ? "大题" : "小题";
    }
    public string GetClass(int clsid)
    {
        var model = new B_Exam_Class().GetSelect(clsid);
        return model == null ? "" : model.C_ClassName;
    }
}
@{
    Model.cols = 5;
    Model.url="Paper_QuestionManage";
}
<table  id="EGV" class="table table-striped table-bordered table-hover">
    <tr>
        <td></td>
        <td>试题标题</td>
        <td>类别</td>
        <td>题目类型</td>
        <td>题型</td>
    </tr>
    @foreach (DataRow dr in Model.dt.Rows)
    {
        <tr>
            <td><input name="idchk" type="checkbox" value="@dr["p_id"]" /></td>
            <td>@dr["p_title"]</td>
            <td>@GetClass(DataConverter.CLng(dr["p_Class"]))</td>
            <td>@GetQuesType(dr)</td>
            <td>@M_Exam_Sys_Questions.GetTypeStr(Convert.ToInt32(dr["p_type"]));</td>
        </tr>
    }
    @Html.Partial("_page",Model)
</table>

@*<ZL:ExGridView ID="EGV" runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" EnableTheming="False" IsHoldState="false"
               class="table table-striped table-bordered table-hover" EmptyDataText="当前没有信息!!" OnPageIndexChanging="EGV_PageIndexChanging">
    <columns>
        
                <asp:linkbutton runat="server" commandname="Upd" commandargument='<%#Eval("p_id") %>'><%# Eval("p_title")%></asp:linkbutton>
            </itemtemplate>
        </asp:templatefield>
        <asp:templatefield headertext="类别" itemstyle-horizontalalign="Center" itemstyle-verticalalign="Middle">
            <itemtemplate>
                <%#GetClass(Eval("p_Class","{0}"))%>
            </itemtemplate>
        </asp:templatefield>
        <asp:templatefield headertext="题目类型">
            <itemtemplate>
                <%#GetQuesType() %>
            </itemtemplate>
        </asp:templatefield>
        <asp:templatefield headertext="题型" itemstyle-horizontalalign="Center" itemstyle-verticalalign="Middle">
            <itemtemplate>
                <%#GetType(Eval("p_Type", "{0}"))%>
            </itemtemplate>
        </asp:templatefield>

    </columns>
</ZL:ExGridView>*@
